package javaDemo12.网络编程;


import java.io.BufferedReader;
import java.io.*;
import java.io.FileReader;
import java.net.Socket;

public class SendDemo {
    public static void main(String[] args) throws IOException {
        Socket s = new Socket("192.168.12.240",40000);

        BufferedReader br = new BufferedReader(new FileReader("D:\\数据库模拟程序设计.txt"));
        BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(s.getOutputStream()));

        String line;

        while((line = br.readLine()) != null && line.isEmpty()){
            bw.write(line,0,line.length());
            bw.newLine();
            bw.flush();
        }

        s.shutdownOutput();

        BufferedReader brServer = new BufferedReader(new InputStreamReader(s.getInputStream()));
        System.out.println("服务器相应为：" + brServer.readLine());

        s.close();
        br.close();





    }

}
